#include "customlistview.h"
#include "twocolumndelegate.h"
#include "widget.h"

#include <QApplication>
#include <QListView>
#include <QStandardItemModel>
#include <QStandardItem>
#include <QStringListModel>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    // QListView listView;
    QStringListModel model;
    QStringList items;
    items << "F101     |                    |Computer                      |我的电脑                      |::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
          << "F0       |                    |Explorer                      |资源管理器                    |explorer.exe /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
          << "F1       |                    |MyDocument                    |我的文档                      |explorer.exe"
          << "F9       |                    |ie                            |IE浏览器                      |iexplore.exe";
    model.setStringList(items);

    // 直接使用stringListModel作为QAbstractItemModel
    QAbstractItemModel* abstractModel = &model;
    // 创建自定义列表视图
    CustomListView *listView = new CustomListView();


    listView->setModel(&model);
    listView->setItemDelegate(new TwoColumnDelegate(listView));

    listView -> show();

    return a.exec();
}
